<template>
  <div >
    <el-descriptions
      title="处方信息"
      border
      :column="4"
      :labelStyle="{ width: '130px' }"
      direction="vertical"
    >
      <el-descriptions-item label="处方药价"
        >￥{{ info.price }}</el-descriptions-item
      >
      <el-descriptions-item label="HIS处方号">{{
        info.hisRecipeNo
      }}</el-descriptions-item>
      <el-descriptions-item label="药品种类数量">{{
        info.drugKindCount
      }}</el-descriptions-item>
      <el-descriptions-item label="HIS处方开具时间">{{
        info.recipeDate
      }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions title="药品信息" style="margin-top: 30px" :colon="false">
      <el-descriptions-item>
        <el-table v-loading="loading" :data="drugList" style="width: 100%">
          <el-table-column
            label="药品编码"
            align="center"
            prop="drugCommonCode"
          />
          <el-table-column label="药品名称" align="center" prop="drugName" />
          <el-table-column
            label="生产企业"
            align="center"
            prop="manufacturer"
          />
          <el-table-column label="频次" align="center" prop="frequencyDesc" />
          <el-table-column label="用法" align="center" prop="usageDesc" />
          <el-table-column label="药品规格" align="center" prop="drugSpec" />
          <el-table-column label="单次剂量" align="center" prop="singleDose" />
          <el-table-column label="疗程" align="center" prop="duration" />
          <el-table-column label="取药量" align="center" prop="amount" />
          <el-table-column
            label="取药量单位"
            align="center"
            prop="amountUnit"
          />
          <el-table-column label="医生备注" align="center" prop="docRemark" e />
          <el-table-column
            label="审单药师备注"
            align="center"
            prop="verifyRemark" 
            width="130"
            show-overflow-tooltip
          />
        </el-table>
<!-- 
        <pagination
          v-show="total > 10"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        /> -->
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { getPrescription, listDrug } from "@/api/pr/basics";

export default {
  name: "Basics",
  dicts: ["yy_prescription_types", "yy_push_types", "yy_push_status"],
  data() {
    return {
      info: {}, 
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 100,
        prescriptionId: "",
      },
      // 处理流转-药品表格数据
      drugList: [],
    };
  },
  created() {},
  methods: {
    /** 查询处理流转-药品列表 */
    getList() {
      this.loading = true;
      listDrug(this.queryParams).then((response) => {
        this.drugList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getdDetail(id) {
      getPrescription({
        basiceId: id,
      }).then((response) => {
        this.info = response.data;
        this.queryParams.prescriptionId = response.data.id;
        this.getList();
      });
    },
  },
};
</script>
